package cn.hrfax.stf.sdk.template;

/**
 * 调用外部服务接口的抽象Action类
 *
 * @author yongSen.wang
 * @date 2019/10/18 14:40
 */
public abstract class AbstractCallRemoteAction<R, P> extends AbstractAction<R, P> {

    private String remoteName;
    private P      param;

    public AbstractCallRemoteAction(String remoteName, P param) {
        this.remoteName = remoteName;
        this.param = param;
    }

    /**
     * 逻辑执行
     *
     * @param p
     * @return
     * @throws RuntimeException
     */
    @Override
    public abstract R doAction(P p) throws RuntimeException;

    public String getRemoteName() {
        return remoteName;
    }

    public P getParam() {
        return param;
    }
}